package com.sky.mapper;


import com.github.pagehelper.Page;
import com.sky.entity.Category;
import com.sky.entity.Employee;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CategoryMapper {

    /*
    菜品分类分页
     */
    Page<Category> pageQuery(String name, Integer type);


    /*
    菜品分类新增分类
     */
    @Insert("insert into category(type, name, sort, status, create_time, update_time, create_user, update_user) VALUES " +
            "(#{type},#{name},#{sort},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    void insertType(Category category);

    /*
    更具id删除分类
     */
    @Delete("delete from category where id = #{id}")
    void deleteById(Long id);

    /*
    根据id修改分类
     */
    void updateById(Category category);

    List<Category> selectByType(Integer type);
}
